import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    orderNo:'',
    orderType:'',
    row:''
  },
  getters: {
  },
  mutations: {
    changeOrderNo(state,orderNo){
      state.orderNo=orderNo;
      try {
        window.localStorage.setItem('orderNo', state.orderNo);
        // 数据改变的时候把数据拷贝一份保存到localStorage里面
      } catch (e) {}
    },
    changeOrderType(state,orderType){
      state.orderType=orderType;
      try {
        window.localStorage.setItem('orderType', state.orderType);
        // 数据改变的时候把数据拷贝一份保存到localStorage里面
      } catch (e) {}
    },
    changeRow(state,row){
      state.row=row;
      try {
        window.localStorage.setItem('row', state.row);
        // 数据改变的时候把数据拷贝一份保存到localStorage里面
      } catch (e) {}
    },
  },
  actions: {
  },
  modules: {
  }
})
